package com.aidex.business.controller.common;

import com.aidex.business.config.BizConfig;
import com.aidex.common.core.domain.AjaxResult;
import java.util.HashMap;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/business/config")
public class ConfigController {

    @Autowired
    private BizConfig bizConfig;

    /**
     * 前端获取业务配置
     *
     * @return
     */
    @GetMapping("/base")
    public AjaxResult getBusinessConfig() {
        Map<String, String> config = new HashMap<String, String>();
        config.put("businessOrgCode", bizConfig.getOrgCode());
        config.put("businessSystemAppID", bizConfig.getSysAppId());
        config.put("businessSystemCode", bizConfig.getSysCode());
        return AjaxResult.success(config);
    }
}
